


# catedict = {'1':'i in list', '2':'i in bejin', '3':'i in sdii'}
#
#
# def get_kwords():
#     klist = []
#     for i in catedict.values():
#         print(i)
#         list = i.split()
#         print(list)
#         klist.extend(list)
#     return set(klist)
#
#
# keys=get_kwords()
# print(keys)
#
# def create_index():
#     dict={}
#     for  i  in keys:
#         keylist=[]
#         for j  in  catedict.keys():
#             if i in catedict[j].split():
#                 keylist.append(j)
#             dict[i]=keylist
#
#     return dict
#
# data=create_index()
# print(data)




data=[{'name': '组织部门', 'url': '/dept', 'id': 3, 'pid': 1, 'pname': '组织管理'},
      {'name': '角色管理', 'url': '/role', 'id': 5, 'pid': 2, 'pname': '菜单权限'},
      {'name': '用户管理', 'url': '/user', 'id': 4, 'pid': 1, 'pname': '组织管理'}]

dict={}
list=[]
dict1={}
for i in data:
    dict['pid']=i['pid']
    dict['pname']=i['pname']
    dict['son']=[]
for j in data:
    dict=j

    # dict1['name']=i['name']
    # dict1['url']=i['url']
    # dict1['id']=i['id']
    # dict1['pid']=i['pid']
print(dict)
# if dict1['pid']==dict['pid']:
#     dict['sono'] = [dict1]
#     list.append(dict)

print(list)
print(dict1)